<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>订单详情</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!-- 项目前置 -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/iconfont.css">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/swiper.min.css">
<link rel="stylesheet" href="css/styles.css">
<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
<script src="js/bootstrap.min.js" charset="UTF-8"></script>
<script src="js/swiper.min.js" charset="UTF-8"></script>
<script src="js/global.js" charset="UTF-8"></script>
<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
<!-- 项目前置 -->
<!-- 本页前置 -->

<!-- 本页前置 -->

</head>

<body>

	<div class="content clearfix bgf5">
		<section class="user-center inner clearfix">
		<%@include file="top.jsp"%>
		<div class="pull-right">
			<div class="user-content__box clearfix bgf">
				<div class="title">订单中心-我的订单</div>
				<div class="order-list__box bgf">
					<div class="order-panel">
						<ul class="nav user-nav__title" role="tablist" id="myul1">
							<li role="presentation" class="nav-item active" ><a
								href="javascript:;" aria-controls="all" role="button" onclick="query(this)">所有订单&nbsp;
								<span class="cr">${countall }</span></a></li>
							<li role="presentation" class="nav-item " ><a href="javascript:;"
								aria-controls="pay" role="button"  onclick="query(this)">待付款 <span
									class="cr">${countPayed }</span></a></li>
							<li role="presentation" class="nav-item " ><a href="javascript:;"
								aria-controls="emit" role="button"  onclick="query(this)">待发货 <span
									class="cr">${countSend }</span></a></li>
							<li role="presentation" class="nav-item " ><a href="javascript:;"
								aria-controls="take" role="button"  onclick="query(this)">待收货 <span
									class="cr">${countState }</span></a></li>
							<li role="presentation" class="nav-item " ><a href="javascript:;" 
								aria-controls="eval" role="button"  onclick="query(this)">待评价 <span
									class="cr" id="span1">${countpingjia }</span></a></li>
						</ul>
						<script type="text/javascript">
						function query(obj) {
							$('#myul1 li').attr("class","nav-item");
							 $('#myul1 li a').each(function (i,n) {
								if($(n).attr("aria-controls")==$(obj).attr("aria-controls")){
									var index=i;
									$('#myul1 li').each(function (i,n){
										if(i==index){
											$(n).attr("class","nav-item active");
										}
									})
								}
							})
								$.post("ToMyOrderServlet",{temp:$(obj).attr("aria-controls")},function(data){									
									$('#all').html(data);
								});							
						}
						
						</script>
					<div class="tab-content">
							<div role="tabpanel" class="tab-pane fade in active" id="all">
								<table class="table text-center">
									<tr>
										<th width="380">商品信息</th>
										<th width="85">单价</th>
										<th width="85">数量</th>
										<th width="120">实付款</th>
										<th width="120">交易状态</th>
										<th width="120">交易操作</th>
									</tr>
									<c:forEach items="${orderlist }" var="o"  varStatus="i" >
									<c:if test="${o.otuihuo!=3 }">
										<tr class="order-item">
											<td><label> <a href="udai_order_detail.html"
													class="num"> ${o.odate } 订单号: ${o.oid } </a>
													<div class="card">
														<div class="img">
															<img src="images/temp/${o.clothes.cimgurl }" alt=""
																class="cover">
														</div>
														<div class="name ep2">${o.clothes.cname }</div>
														<div class="format">颜色分类：${o.clothes.ccolor } 尺码：${o.clothes.csize } </div>
													</div>
											</label></td>
											<td>￥${o.clothes.cprice }</td>
											<td>${o.onum}</td>
											<td>￥${o.clothes.cprice*o.onum }<br> <span class="fz12 c6 text-nowrap">(含运费:
													¥0.00)</span></td>
											<c:if test="${o.opayed==0&&o.osend==0&&o.ostate==0 }">
											<td class="state"><a class="but c6">未付款</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"> </span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(1,${o.oid })"  >立即付款</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" onclick="queren(6,${o.oid })">取消订单</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==0&&o.ostate==0&&o.otuihuo==0 }">
											<td class="state"><a class="but c6">已付款</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(2,${o.oid })" >催促发货</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" onclick="queren(5,${o.oid })">退款/退货</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==0&&o.ostate==0&&o.otuihuo==1 }">
											<td class="state"><a class="but c6">已付款</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary"  >等待商家确认</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" >退款中</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==0&&o.ostate==0&&o.otuihuo==2}">
											<td class="state"><a class="but c6">已付款</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary"  >等待商家确认</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" >退款中</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==0&&o.otuihuo==0 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">物流运输中...</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(3,${o.oid })" >确认收货</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" onclick="queren(5,${o.oid })">退款/退货</a>
											</td>
											</c:if>	
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==0&&o.otuihuo==1 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">物流运输中...</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a>等待商家确认</td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" ></a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" >退款中</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==0&&o.otuihuo==2 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">物流运输中...</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a>等待商家确认</td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" ></a>
												<!-- <a href="" class="but but-link">评价</a> --> <a href="javascript:;"
												class="but c3" >退款中</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==1&&o.otuihuo==0 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">已收货</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(4,${o.oid })" >评价</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a  href="javascript:;"
												class="but c3"  onclick="queren(5,${o.oid })">退货/退款</a>
											</td>
											</c:if>	
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==1&&o.otuihuo==1 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">已收货</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(4,${o.oid })" >评价</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a  href="javascript:;"
												class="but c3">退款中</a>
											</td>
											</c:if>
											<c:if test="${o.opayed==1&&o.osend==1&&o.ostate==1&&o.otuihuo==2 }">
											<td class="state"><a class="but c6">已付款</a>
											<a class="but c6">已收货</a>
											<a href="udai_order_detail.html" class="but c9">订单详情</a></td>
											<td class="order">
												<div class="del">
													<!-- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> -->
												</div> <a href="javascript:;" class="but but-primary" onclick="queren(4,${o.oid })" >评价</a>
												<!-- <a href="" class="but but-link">评价</a> --> <a  href="javascript:;"
												class="but c3">退款中</a>
											</td>
											</c:if>										 
										</tr>
										</c:if>
									</c:forEach>
								</table>
								
								<div class="page text-right clearfix" style="margin-top: 40px">
									<a class="disabled">上一页</a> <a class="select">1</a> <a href="">2</a>
									<a href="">3</a> <a class="" href="">下一页</a>
								</div>
							</div>
							
							<div role="tabpanel" class="tab-pane fade" id="pay">
								<table class="table text-center">
									<tr>
										<th width="380">商品信息</th>
										<th width="85">单价</th>
										<th width="85">数量</th>
										<th width="120">实付款</th>
										<th width="120">交易状态</th>
										<th width="120">交易操作</th>
									</tr>
									<tr class="order-empty">
										<td colspan='6'>
											<div class="empty-msg">
												最近没有任何订单，家里好像缺了点什么！<br> <a href="item_category.html">要不瞧瞧去？</a>
											</div>
										</td>
									</tr>
								</table>
							</div>
							<script type="text/javascript">
								function queren(num,oid) {									
									if(num==3){//确认收货
										var flag=confirm("亲，您确定收货吗?");
										if(flag){//改变Ostate=1 字段  重新刷新 可传temp=对应的变量																					
											location="ToMyOrderServlet?temp=shouhuo&oid="+oid;
										}else{
											location="ToMyOrderServlet?temp=one";			
										}										
									}else if(num==2){//催促发货
										alert("你的请求已发送给店家!");
									}else if(num==1){//立即付款
										var flag=confirm("亲，您确定立刻付款吗?");
										if(flag){//改变属性 Opayed=1  osend=0 重新刷新
											location="ToMyOrderServlet?temp=dofukuan&oid="+oid;																										
										}else{
											location="ToMyOrderServlet?temp=one";
										}
									}else if(num==4){//评价
										//跳转评价的界面！
										prompt("评价");
										/* var oid=$(obj).attr("id"); */
										location="ToMyOrderServlet?temp=pingjia&oid="+oid;
									}else if(num==5){//退款/退货
										location="ToReturnServlet?temp=user&oid="+oid;
									}else if(num==6){//取消订单
										location="ToMyOrderServlet?temp=quxiao&oid="+oid;
									}
								}
								</script>
							<div role="tabpanel" class="tab-pane fade" id="emit">
								<table class="table text-center">
									<tr>
										<th width="380">商品信息</th>
										<th width="85">单价</th>
										<th width="85">数量</th>
										<th width="120">实付款</th>
										<th width="120">交易状态</th>
										<th width="120">交易操作</th>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">等待发货</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="udai_order_receipted.html" class="but but-primary">确认收货</a>
											<a href="udai_apply_return.html" class="but c3">退款/退货</a>
										</td>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">等待发货</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="udai_order_receipted.html" class="but but-primary">确认收货</a>
											<a href="udai_apply_return.html" class="but c3">退款/退货</a>
										</td>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">等待发货</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="udai_order_receipted.html" class="but but-primary">确认收货</a>
											<a href="udai_apply_return.html" class="but c3">退款/退货</a>
										</td>
									</tr>
								</table>
								<div class="page text-right clearfix" style="margin-top: 40px">
									<a class="disabled">上一页</a> <a class="select">1</a> <a
										class="disabled">下一页</a>
								</div>
							</div>
							<div role="tabpanel" class="tab-pane fade" id="take">
								<table class="table text-center">
									<tr>
										<th width="380">商品信息</th>
										<th width="85">单价</th>
										<th width="85">数量</th>
										<th width="120">实付款</th>
										<th width="120">交易状态</th>
										<th width="120">交易操作</th>
									</tr>
									<tr class="order-empty">
										<td colspan='6'>
											<div class="empty-msg">
												最近没有任何订单，家里好像缺了点什么！<br> <a href="item_category.html">要不瞧瞧去？</a>
											</div>
										</td>
									</tr>
								</table>
							</div>
							<div role="tabpanel" class="tab-pane fade" id="eval">
								<table class="table text-center">
									<tr>
										<th width="380">商品信息</th>
										<th width="85">单价</th>
										<th width="85">数量</th>
										<th width="120">实付款</th>
										<th width="120">交易状态</th>
										<th width="120">交易操作</th>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">交易成功</a> <a
											href="udai_mail_query.html" class="but cr">查看物流</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="" class="but but-link">评价</a> <a href=""
											class="but c3">取消订单</a>
										</td>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">交易成功</a> <a
											href="udai_mail_query.html" class="but cr">查看物流</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="" class="but but-link">评价</a> <a href=""
											class="but c3">取消订单</a>
										</td>
									</tr>
									<tr class="order-item">
										<td><label> <a href="udai_order_detail.html"
												class="num"> 2017-03-30 订单号: 2669901385864042 </a>
												<div class="card">
													<div class="img">
														<img src="images/temp/item-img_1.jpg" alt="" class="cover">
													</div>
													<div class="name ep2">纯色圆领短袖T恤活动衫弹力柔软纯色圆领短袖T恤</div>
													<div class="format">颜色分类：深棕色 尺码：均码</div>
													<div class="favour">使用优惠券：优惠¥2.00</div>
												</div>
										</label></td>
										<td>￥100</td>
										<td>1</td>
										<td>￥1000<br> <span class="fz12 c6 text-nowrap">(含运费:
												¥0.00)</span></td>
										<td class="state"><a class="but c6">交易成功</a> <a
											href="udai_mail_query.html" class="but cr">查看物流</a> <a
											href="udai_order_detail.html" class="but c9">订单详情</a></td>
										<td class="order">
											<div class="del">
												<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
											</div> <a href="" class="but but-link">评价</a> <a href=""
											class="but c3">取消订单</a>
										</td>
									</tr>
								</table>
								<div class="page text-right clearfix" style="margin-top: 40px">
									<a class="disabled">上一页</a> <a class="select">1</a> <a
										class="disabled">下一页</a>
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
		</section>
	</div>
	<script>
			$(document).ready(function() {
				$('.to-top').toTop({
					position : false
				})
			});
		</script>
	<!-- 右侧菜单 -->
	<!-- 底部信息 -->
	<%@include file="bottom.jsp"%>
</body>
</html>
